
export default {
  namespaced: true,
  state: {
    // 用户token信息
    refresh_token: localStorage.getItem('token') || '',
    token: localStorage.getItem('refresh_token') || ''
  },
  getters: {
  },
  mutations: {
    setTokenInfo (state, value) {
      state.refresh_token = value.refresh_token
      state.token = value.token
      // 将token存在本地
      localStorage.setItem('token', value.token)
      localStorage.setItem('refresh_token', value.refresh_token)
    },
    removeTokenInfo (state) {
      localStorage.removeItem('token')
      localStorage.removeItem('refresh_token')
      state.refresh_token = ''
      state.token = ''
    }
  },
  actions: {
  },
  modules: {
  }
}
